import request from "@/utils/request.js";
import utils from "@/utils/utils.js"

export default {
	// 我的寄卖历史
	ocr(params) {
		return request({
			url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/doc_analysis?access_token=' + params.token,
			// url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/accurate?access_token=' + params.token,
			method: 'post',
			header: {
				"content-type": "application/x-www-form-urlencoded"
			},
			data: params
		})
	},
	normalOcr(params) {
		return request({
			// url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/doc_analysis?access_token=' + params.token,
			url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/accurate?access_token=' + params.token,
			method: 'post',
			header: {
				"content-type": "application/x-www-form-urlencoded"
			},
			data: params
		})
	},
	getWechatAccessToken(params) {
		return request({
			// url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/doc_analysis?access_token=' + params.token,
			url: 'https://api.weixin.qq.com/cgi-bin/token',
			method: 'get',
			data: params
		})
	},
	getAccessToken(params) {
		return request({
			// url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/doc_analysis?access_token=' + params.token,
			url: 'https://dreamseeker.space/baiduToken.txt?t=' + Math.random(),
			method: 'get',
			data: params
		})
	},
}
